package com.insist.dao;

import com.insist.entity.ChargeInfo;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * Created by Administrator on 2015/11/6.
 */
public interface ChargeDao extends JpaRepository<ChargeInfo,Long> {

    List<ChargeInfo> findByUserId(Long loginUserId);

    ChargeInfo getByPayNo(String transactionId);

    List<ChargeInfo> findByUserIdAndState(Long loginUserId, Integer state);

    @Query("select max(o.payNo) from ChargeInfo o")
    String getMaxOrderNo();

}
